package main

import (
	"rbac-abac-demo/middleware"
	"rbac-abac-demo/utils"

	"rbac-abac-demo/controllers"

	"github.com/gin-gonic/gin"
)

func main() {
	// 加载配置文件
	utils.LoadConfig()

	r := gin.Default()

	// 所有权限检查需先认证
	r.Use(middleware.AuthMiddleware())

	// 权限检查接口
	r.POST("/check", controllers.CheckAccess)

	// 启动服务
	r.Run(":8080")
}
